// import { Context } from "vm";

import cors from 'koa2-cors';
import { koaBody } from 'koa-body';
import router from './route'
import logger from 'koa-logger'

const Koa = require('koa');
const app = new Koa();

app.use(cors({ origin: () => '*' }))
// .use(bodyParser())
.use(logger())
.use(koaBody({
  multipart: true,
  formidable: {
    maxFileSize: 4000 * 1024 * 1024,
  },
}))
.use(router.routes())
.use(router.allowedMethods());

app.listen(3000);
